import requests

headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEzMTk3LCJpc3MiOiJjZ2Jvc3MiLCJleHAiOjE3NDUyMjc0NjcsIm5iZiI6MTc0MjYzNTQ2NywiaWF0IjoxNzQyNjM1NDY3fQ.3czi0TmCXyzpMf4M9LqheCM_zHr9U-df9YdjhaO1F5s"
}
session = requests.session()


class BundleApi:

    @staticmethod
    def related_instances(request_data):
        resp = session.post(url=f"https://cgboss.yuntiancloud.com/api/cgbundle/v1/service_groups/related_instances",
                            headers=headers, json=request_data)
        if resp.status_code == 200:
            return resp.json()

    @staticmethod
    def get_x86_vm_list_by_instances(request_data):
        resp = session.post(url=f"https://cgboss.yuntiancloud.com/api/cginstance/v1/vm/list", headers=headers,
                            json=request_data)
        if resp.status_code == 200:
            return resp.json()

